<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">

<head>
    <th:block th:include="include :: header('课程学习')"/>
    <link href="../static/css/nowcomment.css" th:href="@{/css/nowcomment.css}" rel="stylesheet"/>*
    <style>

    </style>
</head>
<!--<body class="gray-bg">-->
<body class="signin">
<div class="wrapper wrapper-content animated fadeInRight" th:object="${course}">
    <input id="cid" th:field="*{cid}" type="hidden">
   <!-- <div class="row">
        <div class="col-sm-2">
        </div>
        <div class="col-sm-8">
            <div class="ibox float-e-margins">
                <div class="ibox-title" align="center">
                    <h1 th:text="*{cname}" ></h1>
                </div>
            </div>
        </div>
        <div class="col-sm-2">
        </div>
    </div>-->
    <div class="row">
        <div class="col-sm-2">
        </div>
            <!--<div class="contain_djBooks col-sm-8">
                <h4 class="tgTitle"><strong>课程描述</strong></h4>
                <div class="text-intro">
                    <p th:text="*{cdesc}"></p>
                </div>
            </div>-->
        <div class="col-sm-8">

            <div class="panel panel-warning">
                <div class="panel-heading" align="center">
                    <p th:text="*{cname}" stype="font-size:25px"></p>
                </div>
                <div class="panel-body kge">
                  <p th:text="*{cdesc}"></p>
                </div>
               <!-- <div class="panel-footer">
                    面板Footer
                </div>-->
            </div>
        </div>
        <div class="col-sm-2">
        </div>
    </div>
    <div class="row">
        <div class="col-sm-2">
        </div>
        <div class="col-sm-8">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <h5>课程内容</h5>
                </div>
                <div class="ibox-content no-padding" id="eg">
                    <div class="summernote" th:utext="*{ctext}">

                    </div>
                </div>
            </div>
        </div>
        <div class="col-sm-2">
        </div>
    </div>
</div>
<th:block th:include="include :: footer" />
<script th:src="@{/js/plugins/timers/jquery.timers-1.2.js}"></script>
<!--<script th:src="@{/self/courseadd.js}"></script>-->
<script th:inline="javascript">
    var prefix = ctx + "self/courserecord";
    var courseId = $("#cid").val();
    var formData = new FormData();
    formData.append('courseId', courseId);

    $(function(){
        $('body').everyTime('60s','A',function(){
            // 验证用户是否具备某角色
            var role = [[${@permission.hasAnyRoles('activist,probationary')}]];
            if (role == "") {   //含有此角色
                $.ajax({
                    url: prefix + "/updateTime",
                    type: 'post',
                    cache: false,
                    data: formData,
                    processData: false,
                    contentType: false,
                    dataType: "json",
                    success: function (result) {
                        //console.log("result is:",result);
                    }
                });
            }
        });
    });


</script>
</body>
</html>